home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / psion / menuprob < prev    next >
Text File  |  1995-03-31  |  2KB  |  53 lines

  1. PSIONICS FILE - MENUPROB
  2. ========================
  3. Series 3s menu problem workaround
  4. Last modified 1994-09-12
  5. =================================
  6.  
  7. There are some circumstances in which OPL programs with menus can gradually
  8. lose small amounts of system memory.
  9.  
  10. All memory lost in this way is fully recovered by the Series 3s when the OPL
  11. application exits, but if the application runs for a long time without
  12. exiting, it is possible that the cumulative amount of memory lost will in time
  13. adversely affect performance.
  14.  
  15. This bug is present in all versions of the Series 3s (but has been fixed in
  16. the 3a). It does not affect any programs written in C.
  17.  
  18. To work around the bug, replace all occurences of the MENU keyword with
  19. calls to a new procedure MENU%: which in turn calls the MENU keyword and
  20. some machine code. The inconvenience of requiring an extra layer around calls
  21. to MENU is slight for commercial OPL programs, since these programs are likely
  22. to have such a layer already (for example to make calls to LOCK on
  23. either side of the call to MENU). This layer can be merged with the MENU%:
  24. procedure shown here. The contents of MENU%: may of course be placed in-line
  25. instead of in a separate procedure.
  26.  
  27. The machine code called by the USR commands automatically detects the case
  28. when no memory has been lost by the MENU command and does nothing.
  29.  
  30.     PROC MENU%:
  31.       LOCAL r%
  32.       LOCAL x1&(7),x2&(7),x3&(8)
  33.  
  34.       x1&(1)=&8BF88BFC
  35.       x1&(2)=&8B00121E
  36.       x1&(3)=&778B205F
  37.       x1&(4)=&E42AAC0C
  38.       x1&(5)=&A5ABC88B
  39.       x1&(6)=&75C084AC
  40.       x1&(7)=&CBF8E2FB
  41.       x2&(1)=&00B4F08B
  42.       x2&(2)=&FC808BCD
  43.       x2&(3)=&AD0D7330
  44.       x2&(4)=&C932D08B
  45.       x2&(5)=&CDD88BAD
  46.       x2&(6)=&F8754ACF
  47.       x2&(7)=&000000CB
  48.       USR(ADDR(x1&(1)),ADDR(x3&(1)),0,0,0)
  49.       r%=MENU
  50.       USR(ADDR(x2&(1)),ADDR(x3&(1)),0,0,0)
  51.       RETURN(r%)
  52.     ENDP
  53.